Remove unused stuff
This commit is contained in:
@@ -18,11 +18,7 @@
|
||||
|
||||
package appeng.bootstrap;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@@ -31,22 +27,6 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
*/
|
||||
public interface IItemRendering {
|
||||
|
||||
/**
|
||||
* Convenient override for {@link #variants(Collection)}.
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
default IItemRendering variants(ResourceLocation... resources) {
|
||||
return this.variants(Arrays.asList(resources));
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the item variants of this item. This are all models that need to be
|
||||
* loaded for this item. This has no direct effect on rendering, but is used to
|
||||
* load models that are used for example by the ItemMeshDefinition.
|
||||
*/
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
IItemRendering variants(Collection<ResourceLocation> resources);
|
||||
|
||||
/**
|
||||
* Registers a custom item color definition that inspects an item stack and tint
|
||||
* and returns a color multiplier.
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2017, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.bootstrap;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public interface IModelRegistry {
|
||||
void registerItemVariants(Item item, ResourceLocation... names);
|
||||
|
||||
}
|
||||
@@ -18,33 +18,18 @@
|
||||
|
||||
package appeng.bootstrap;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.bootstrap.components.ItemColorComponent;
|
||||
import appeng.bootstrap.components.ItemVariantsComponent;
|
||||
|
||||
class ItemRendering implements IItemRendering {
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
private IItemColor itemColor;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
private Set<ResourceLocation> variants = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public IItemRendering variants(Collection<ResourceLocation> resources) {
|
||||
this.variants.addAll(resources);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public IItemRendering color(IItemColor itemColor) {
|
||||
@@ -53,12 +38,6 @@ class ItemRendering implements IItemRendering {
|
||||
}
|
||||
|
||||
void apply(FeatureFactory factory, Item item) {
|
||||
Set<ResourceLocation> resources = new HashSet<>(this.variants);
|
||||
|
||||
if (!resources.isEmpty()) {
|
||||
factory.addBootstrapComponent(new ItemVariantsComponent(item, resources));
|
||||
}
|
||||
|
||||
if (this.itemColor != null) {
|
||||
factory.addBootstrapComponent(new ItemColorComponent(item, this.itemColor));
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.bootstrap.components;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
import appeng.bootstrap.IBootstrapComponent;
|
||||
import appeng.bootstrap.IModelRegistry;
|
||||
|
||||
/**
|
||||
* @author GuntherDW
|
||||
*/
|
||||
|
||||
@FunctionalInterface
|
||||
public interface IModelRegistrationComponent extends IBootstrapComponent {
|
||||
void modelRegistration(Dist dist, IModelRegistry registry);
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.bootstrap.components;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
import appeng.bootstrap.IModelRegistry;
|
||||
|
||||
/**
|
||||
* Registers a custom item mesh definition that can be used to dynamically
|
||||
* determine the item model based on item stack properties.
|
||||
*/
|
||||
public class ItemMeshDefinitionComponent implements IModelRegistrationComponent {
|
||||
|
||||
// FIXME private final Item item;
|
||||
// FIXME
|
||||
// FIXME private final ItemMeshDefinition meshDefinition;
|
||||
|
||||
// FIXME public ItemMeshDefinitionComponent( @Nonnull Item item, @Nonnull ItemMeshDefinition meshDefinition )
|
||||
// FIXME {
|
||||
// FIXME this.item = item;
|
||||
// FIXME this.meshDefinition = meshDefinition;
|
||||
// FIXME }
|
||||
|
||||
@Override
|
||||
public void modelRegistration(Dist dist, IModelRegistry registry) {
|
||||
// FIXME registry.setCustomMeshDefinition( this.item, this.meshDefinition );
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.bootstrap.components;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
import appeng.bootstrap.IModelRegistry;
|
||||
|
||||
public class ItemVariantsComponent implements IModelRegistrationComponent {
|
||||
|
||||
private final Item item;
|
||||
|
||||
private final Collection<ResourceLocation> resources;
|
||||
|
||||
public ItemVariantsComponent(Item item, Collection<ResourceLocation> resources) {
|
||||
this.item = item;
|
||||
this.resources = resources;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modelRegistration(Dist dist, IModelRegistry registry) {
|
||||
ResourceLocation[] resourceArr = this.resources.toArray(new ResourceLocation[0]);
|
||||
registry.registerItemVariants(this.item, resourceArr);
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.bootstrap.components;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
import appeng.bootstrap.IModelRegistry;
|
||||
|
||||
/**
|
||||
* Registers a custom state mapper for a given block.
|
||||
*/
|
||||
public class StateMapperComponent implements IModelRegistrationComponent {
|
||||
|
||||
// FIXME private final Block block;
|
||||
|
||||
// FIXME private final IStateMapper stateMapper;
|
||||
// FIXME
|
||||
// FIXME public StateMapperComponent( Block block, IStateMapper stateMapper )
|
||||
// FIXME {
|
||||
// FIXME this.block = block;
|
||||
// FIXME this.stateMapper = stateMapper;
|
||||
// FIXME }
|
||||
|
||||
@Override
|
||||
public void modelRegistration(Dist dist, IModelRegistry registry) {
|
||||
// FIXME registry.setCustomStateMapper( this.block, this.stateMapper );
|
||||
// FIXME if( this.stateMapper instanceof IResourceManagerReloadListener )
|
||||
// FIXME {
|
||||
// FIXME ( (IReloadableResourceManager)
|
||||
// Minecraft.getInstance().getResourceManager() )
|
||||
// FIXME .registerReloadListener( (IResourceManagerReloadListener)
|
||||
// this.stateMapper );
|
||||
// FIXME }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user