Merge remote-tracking branch 'origin/1.12' into 1.12

This commit is contained in:
modmuss50 2018-02-11 14:01:45 +00:00
commit 9c3d9d8e27
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
16 changed files with 237 additions and 26 deletions

View file

@ -93,7 +93,7 @@ if (ENV.BUILD_NUMBER) {
} }
minecraft { minecraft {
version = "1.12.2-14.23.1.2590" version = "1.12.2-14.23.2.2613"
mappings = "snapshot_20171003" mappings = "snapshot_20171003"
replace "@MODVERSION@", project.version replace "@MODVERSION@", project.version
useDepAts = true useDepAts = true

View file

@ -1,4 +1,4 @@
#Mon Jun 19 11:12:24 BST 2017 #Fri Feb 09 20:12:54 AEDT 2018
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View file

@ -29,13 +29,18 @@ import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar; import prospector.shootingstar.ShootingStar;
@ -46,7 +51,7 @@ import techreborn.lib.ModInfo;
import techreborn.tiles.TileAlarm; import techreborn.tiles.TileAlarm;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.List;
public class BlockAlarm extends BaseTileBlock { public class BlockAlarm extends BaseTileBlock {
public static PropertyDirection FACING; public static PropertyDirection FACING;
@ -65,6 +70,7 @@ public class BlockAlarm extends BaseTileBlock {
} }
private AxisAlignedBB[] bbs; private AxisAlignedBB[] bbs;
public BlockAlarm() { public BlockAlarm() {
super(Material.ROCK); super(Material.ROCK);
setUnlocalizedName("techreborn.alarm"); setUnlocalizedName("techreborn.alarm");
@ -81,6 +87,21 @@ public class BlockAlarm extends BaseTileBlock {
return new BlockStateContainer(this, FACING, ACTIVE); return new BlockStateContainer(this, FACING, ACTIVE);
} }
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
TileAlarm tileEntity = (TileAlarm) worldIn.getTileEntity(pos);
if (tileEntity == null) {
return super.onBlockActivated(worldIn, pos, state, playerIn, hand, facing, hitX, hitY, hitZ);
} else {
if (!worldIn.isRemote) {
if (playerIn.isSneaking()) {
tileEntity.rightClick();
}
}
}
return true;
}
@Override @Override
public int getMetaFromState(IBlockState state) { public int getMetaFromState(IBlockState state) {
int facingInt = state.getValue(FACING).getIndex(); int facingInt = state.getValue(FACING).getIndex();
@ -90,8 +111,8 @@ public class BlockAlarm extends BaseTileBlock {
@Override @Override
public IBlockState getStateFromMeta(int meta) { public IBlockState getStateFromMeta(int meta) {
Boolean active = (meta&8)==8; Boolean active = (meta & 8) == 8;
EnumFacing facing = EnumFacing.getFront(meta&7); EnumFacing facing = EnumFacing.getFront(meta & 7);
return this.getDefaultState().withProperty(FACING, facing).withProperty(ACTIVE, active); return this.getDefaultState().withProperty(FACING, facing).withProperty(ACTIVE, active);
} }
@ -100,7 +121,7 @@ public class BlockAlarm extends BaseTileBlock {
} }
public static EnumFacing getFacing(IBlockState state) { public static EnumFacing getFacing(IBlockState state) {
return (EnumFacing)state.getValue(FACING); return (EnumFacing) state.getValue(FACING);
} }
public static void setFacing(EnumFacing facing, World world, BlockPos pos) { public static void setFacing(EnumFacing facing, World world, BlockPos pos) {
@ -145,8 +166,13 @@ public class BlockAlarm extends BaseTileBlock {
} }
@Override @Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
return this.bbs[getFacing(state).getIndex()]; return this.bbs[getFacing(state).getIndex()];
} }
@Override
public void addInformation(final ItemStack stack, final World world, final List<String> tooltip, ITooltipFlag flag) {
tooltip.add(TextFormatting.GRAY + I18n.format("techreborn.tooltip.alarm"));
}
} }

View file

@ -33,6 +33,7 @@ import techreborn.client.container.ContainerDestructoPack;
import techreborn.client.container.IContainerProvider; import techreborn.client.container.IContainerProvider;
import techreborn.client.gui.*; import techreborn.client.gui.*;
import techreborn.client.gui.autocrafting.GuiAutoCrafting; import techreborn.client.gui.autocrafting.GuiAutoCrafting;
import techreborn.items.tools.ItemTechManual;
import techreborn.tiles.*; import techreborn.tiles.*;
import techreborn.tiles.fusionReactor.TileFusionControlComputer; import techreborn.tiles.fusionReactor.TileFusionControlComputer;
import techreborn.tiles.generator.*; import techreborn.tiles.generator.*;
@ -152,9 +153,11 @@ public class GuiHandler implements IGuiHandler {
case AUTO_CRAFTING_TABLE: case AUTO_CRAFTING_TABLE:
return new GuiAutoCrafting(player, (TileAutoCraftingTable) tile); return new GuiAutoCrafting(player, (TileAutoCraftingTable) tile);
case PLASMA_GENERATOR: case PLASMA_GENERATOR:
return new GuiPlasmaGenerator(player, (TilePlasmaGenerator) tile); return new GuiPlasmaGenerator(player, (TilePlasmaGenerator) tile);
case DISTILLATION_TOWER: case DISTILLATION_TOWER:
return new GuiDistillationTower(player, (TileDistillationTower) tile); return new GuiDistillationTower(player, (TileDistillationTower) tile);
case MANUAL:
return new GuiManual(player);
default: default:
break; break;

View file

@ -0,0 +1,117 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiConfirmOpenLink;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import techreborn.items.tools.ItemTechManual;
import java.awt.*;
public class GuiManual extends GuiScreen {
ItemTechManual manual;
EntityPlayer player;
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/manual.png");
int guiWidth = 207;
int guiHeight = 195;
private static final String text1 = I18n.format("techreborn.manual.wiki");
private static final String text2 = I18n.format("techreborn.manual.discord");
public GuiManual(EntityPlayer player) {
this.player = player;
}
@Override
public boolean doesGuiPauseGame() {
return false;
}
@Override
public void initGui() {
this.buttonList.add(new GuiButton(1, (width / 2 - 30), (height / 2 - (guiHeight / 4)) + 17, 60, 20, I18n.format("techreborn.manual.wikibtn")));
this.buttonList.add(new GuiButton(2, (width / 2 - 30), (height / 2) + 22, 60, 20, I18n.format("techreborn.manual.discordbtn")));
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawDefaultBackground();
this.mc.getTextureManager().bindTexture(GuiManual.texture);
int centerX = (width / 2) - guiWidth / 2;
int centerY = (height / 2) - guiHeight / 2;
drawTexturedModalRect(centerX, centerY, 0, 0, guiWidth, guiHeight);
this.fontRenderer.drawString(text1, ((width / 2) - this.fontRenderer.getStringWidth(text1) / 2), height / 2 - (guiHeight / 4), 4210752);
this.fontRenderer.drawString(text2, ((width / 2) - this.fontRenderer.getStringWidth(text2) / 2), height / 2 + 5, 4210752);
super.drawScreen(mouseX, mouseY, partialTicks);
}
@Override
protected void actionPerformed(GuiButton button) {
switch (button.id) {
case 1:
this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, "http://wiki.techreborn.ovh", 1, false));
break;
case 2:
this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, "http://discord.gg/0tCDWb77cvetwm0e", 2, false));
break;
}
}
@Override
public void confirmClicked(boolean result, int id) {
switch(id) {
case 1:
if(result == true) {
try {
Desktop.getDesktop().browse(new java.net.URI("http://wiki.techreborn.ovh"));
} catch (Exception e) {
System.err.print(e);
}
}else {
this.mc.displayGuiScreen(this);
}
break;
case 2:
if(result == true) {
try {
Desktop.getDesktop().browse(new java.net.URI("http://discord.gg/0tCDWb77cvetwm0e"));
} catch (Exception e) {
System.err.print(e);
}
}else {
this.mc.displayGuiScreen(this);
}
break;
}
}
}

View file

@ -44,6 +44,8 @@ public class ModSounds {
public static SoundEvent MACHINE_RUN; public static SoundEvent MACHINE_RUN;
public static SoundEvent MACHINE_START; public static SoundEvent MACHINE_START;
public static SoundEvent ALARM; public static SoundEvent ALARM;
public static SoundEvent ALARM_2;
public static SoundEvent ALARM_3;
public static void init() { public static void init() {
CABLE_SHOCK = getSound("cable_shock"); CABLE_SHOCK = getSound("cable_shock");
@ -53,6 +55,8 @@ public class ModSounds {
MACHINE_RUN = getSound("machine_run"); MACHINE_RUN = getSound("machine_run");
MACHINE_START = getSound("machine_start"); MACHINE_START = getSound("machine_start");
ALARM = getSound("alarm"); ALARM = getSound("alarm");
ALARM_2 = getSound("alarm_2");
ALARM_3 = getSound("alarm_3");
RecipeCrafter.soundHanlder = new SoundHandler(); RecipeCrafter.soundHanlder = new SoundHandler();
} }

View file

@ -24,22 +24,18 @@
package techreborn.items.tools; package techreborn.items.tools;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.client.resources.I18n;
import net.minecraft.world.World; import net.minecraft.world.World;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.items.ItemTR; import techreborn.items.ItemTR;
import java.util.List;
public class ItemTechManual extends ItemTR { public class ItemTechManual extends ItemTR {
public ItemTechManual() { public ItemTechManual() {
@ -51,13 +47,8 @@ public class ItemTechManual extends ItemTR {
@Override @Override
public ActionResult<ItemStack> onItemRightClick(final World world, final EntityPlayer player, public ActionResult<ItemStack> onItemRightClick(final World world, final EntityPlayer player,
final EnumHand hand) { final EnumHand hand) {
player.openGui(Core.INSTANCE, EGui.MANUAL.ordinal(), world, (int) player.posX, (int) player.posY, player.openGui(Core.INSTANCE, EGui.MANUAL.ordinal(), world, (int) player.posX, (int) player.posY, (int) player.posY);
(int) player.posY);
return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
} }
@Override
public void addInformation(final ItemStack stack, final World world, final List<String> tooltip, ITooltipFlag flag) {
tooltip.add(TextFormatting.RED + I18n.format("tooltip.wip"));
}
} }

View file

@ -32,4 +32,5 @@ public class MessageIDs {
public static int fluidPipeID = 1; public static int fluidPipeID = 1;
public static int playerDetectorID = 2; public static int playerDetectorID = 2;
public static int nanosaberID = 3; public static int nanosaberID = 3;
public static int alarmID = 4;
} }

View file

@ -24,25 +24,67 @@
package techreborn.tiles; package techreborn.tiles;
import net.minecraft.client.resources.I18n;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ITickable; import net.minecraft.util.ITickable;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import reborncore.common.util.ChatUtils;
import techreborn.blocks.BlockAlarm; import techreborn.blocks.BlockAlarm;
import techreborn.init.ModSounds; import techreborn.init.ModSounds;
import techreborn.lib.MessageIDs;
public class TileAlarm extends TileEntity implements ITickable { public class TileAlarm extends TileEntity implements ITickable {
boolean state = false; private int selectedSound = 1;
int selectedSound;
@Override @Override
public void update() { public void update() {
if (!world.isRemote && world.getTotalWorldTime() % 25 == 0 && world.isBlockPowered(getPos())) { if (!world.isRemote && world.getTotalWorldTime() % 25 == 0 && world.isBlockPowered(getPos())) {
BlockAlarm.setActive(true, world, pos); BlockAlarm.setActive(true, world, pos);
world.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), ModSounds.ALARM, SoundCategory.BLOCKS, 4F, 1F); switch (selectedSound) {
state = true; case 1:
world.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), ModSounds.ALARM, SoundCategory.BLOCKS, 4F, 1F);
break;
case 2:
world.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), ModSounds.ALARM_2, SoundCategory.BLOCKS, 4F, 1F);
break;
case 3:
world.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), ModSounds.ALARM_3, SoundCategory.BLOCKS, 4F, 1F);
break;
}
} else if (!world.isRemote && world.getTotalWorldTime() % 25 == 0) { } else if (!world.isRemote && world.getTotalWorldTime() % 25 == 0) {
BlockAlarm.setActive(false, world, pos); BlockAlarm.setActive(false, world, pos);
state = false; }
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
if (compound == null) {
compound = new NBTTagCompound();
}
compound.setInteger("selectedSound", this.selectedSound);
return super.writeToNBT(compound);
}
@Override
public void readFromNBT(NBTTagCompound compound) {
if (compound != null && compound.hasKey("selectedSound")) {
this.selectedSound = compound.getInteger("selectedSound");
}
super.readFromNBT(compound);
}
public void rightClick() {
if (!world.isRemote) {
if (selectedSound < 3) {
selectedSound++;
} else {
selectedSound = 1;
}
ChatUtils.sendNoSpamMessages(MessageIDs.alarmID, new TextComponentString(TextFormatting.GRAY + I18n.format("techreborn.message.alarm") + " " + "Alarm " + selectedSound));
} }
} }
} }

View file

@ -654,6 +654,7 @@ techreborn.message.noCoordsSet=No Coordinates Set
techreborn.message.coordsHaveBeen=Coordinates have been techreborn.message.coordsHaveBeen=Coordinates have been
techreborn.message.cleared=Cleared techreborn.message.cleared=Cleared
techreborn.message.detects=Detects techreborn.message.detects=Detects
techreborn.message.alarm=Switched to:
techreborn.message.allPlayers=All Players techreborn.message.allPlayers=All Players
techreborn.message.onlyOtherPlayers=Only Other Players techreborn.message.onlyOtherPlayers=Only Other Players
techreborn.message.onlyYou=Only You techreborn.message.onlyYou=Only You
@ -717,6 +718,13 @@ techreborn.tooltip.inventory=Inventory
techreborn.tooltip.upgrades=Upgrades techreborn.tooltip.upgrades=Upgrades
techreborn.tooltip.transferRate=Transfer Rate techreborn.tooltip.transferRate=Transfer Rate
techreborn.tooltip.tier=Tier techreborn.tooltip.tier=Tier
techreborn.tooltip.alarm=Shift rightclick to change sound
#ManualUI
techreborn.manual.wiki=Online wiki
techreborn.manual.discord=Our discord
techreborn.manual.wikibtn=Open
techreborn.manual.discordbtn=Join
#Advancements #Advancements

View file

@ -40,5 +40,17 @@
"sounds": [ "sounds": [
"techreborn:alarm" "techreborn:alarm"
] ]
},
"alarm_2": {
"category": "block",
"sounds": [
"techreborn:alarm_2"
]
},
"alarm_3": {
"category": "block",
"sounds": [
"techreborn:alarm_3"
]
} }
} }

View file

@ -0,0 +1,7 @@
alarm_2
by rene___
https://freesound.org/people/rene___/sounds/56778/
alarm_3
by plasterbrain
https://freesound.org/people/plasterbrain/sounds/242856/

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 B

View file

@ -10,7 +10,7 @@
"authorList": [ "authorList": [
"modmuss50", "Gigabit101", "Prospector" "modmuss50", "Gigabit101", "Prospector"
], ],
"credits": "Thanks to these contributors: TheMattaBase, Mj11jM, Mazdallier, tntrololol, joflashstudios, drcrazy, lclc98, Lordmau5, mezz, and Thog", "credits": "Thanks to these contributors: TheMattaBase, Mj11jM, Mazdallier, tntrololol, joflashstudios, drcrazy, lclc98, Lordmau5, mezz, Thog, and Dimmerworld",
"logoFile": "logo.png", "logoFile": "logo.png",
"screenshots": [ "screenshots": [
], ],