mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 13:09:47 +00:00
Some reformat code for 1.11.2 source (#84)
* Optimized imports * Some code reformat * Some refactoring and code reformat * Some code reformat
This commit is contained in:
1 parent
886c36a308
commit
c3809fbc27
508 files changed
+6677
-6238
No files matched your search
@@ -23,13 +23,27 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public class ExtraBeesClientProxy extends ExtraBeesCommonProxy {
|
||||
|
||||
private static final ModelManager modelManager = ModelManager.getInstance();
|
||||
|
||||
private static IBakedModel bakeModelFor(Block block) {
|
||||
return new BlankModel() {
|
||||
|
||||
@Override
|
||||
protected ItemOverrideList createOverrides() {
|
||||
return new ItemOverrideList(ImmutableList.of()) {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity) {
|
||||
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(block.getStateFromMeta(stack.getMetadata()));
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block registerBlock(Block block) {
|
||||
modelManager.registerBlockClient(block);
|
||||
@@ -49,34 +63,14 @@ public class ExtraBeesClientProxy extends ExtraBeesCommonProxy {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onModelsBaked(ModelBakeEvent event){
|
||||
public void onModelsBaked(ModelBakeEvent event) {
|
||||
IRegistry<ModelResourceLocation, IBakedModel> registry = event.getModelRegistry();
|
||||
registerItemBlockLink(new ExtraBeesResourceLocation("alveary"), ExtraBees.alveary, registry);
|
||||
registerItemBlockLink(new ExtraBeesResourceLocation("ectoplasm"), ExtraBees.ectoplasm, registry);
|
||||
registerItemBlockLink(new ExtraBeesResourceLocation("hive"), ExtraBees.hive, registry);
|
||||
}
|
||||
|
||||
private void registerItemBlockLink(ResourceLocation item, Block block, IRegistry<ModelResourceLocation, IBakedModel> registry){
|
||||
private void registerItemBlockLink(ResourceLocation item, Block block, IRegistry<ModelResourceLocation, IBakedModel> registry) {
|
||||
registry.putObject(new ModelResourceLocation(item, "inventory"), bakeModelFor(block));
|
||||
}
|
||||
|
||||
private static IBakedModel bakeModelFor(Block block){
|
||||
return new BlankModel() {
|
||||
|
||||
@Override
|
||||
protected ItemOverrideList createOverrides() {
|
||||
return new ItemOverrideList(ImmutableList.of()){
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity) {
|
||||
return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(block.getStateFromMeta(stack.getMetadata()));
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,28 +6,24 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
/**
|
||||
* Created by Elec332 on 12-5-2017.
|
||||
*/
|
||||
public class ExtraBeesCommonProxy {
|
||||
|
||||
public void registerBeeModel(ExtraBeesSpecies type) {
|
||||
}
|
||||
|
||||
public Block registerBlock(Block block){
|
||||
public Block registerBlock(Block block) {
|
||||
return GameRegistry.register(block);
|
||||
}
|
||||
|
||||
public Item registerItem(Item item){
|
||||
public Item registerItem(Item item) {
|
||||
return GameRegistry.register(item);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public String localise(String s){
|
||||
public String localise(String s) {
|
||||
return I18n.translateToLocal(s);
|
||||
}
|
||||
|
||||
public void registerModel(Item item, int meta) {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user